package com.aiyige.page.publish.selectlocation.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by zhuyakun on 2018/3/19.
 */

public class SelectLocationData implements Parcelable {
    String province;
    String city;
    String cityId;

    public SelectLocationData() {
    }

    private SelectLocationData(Builder builder) {
        setProvince(builder.province);
        setCity(builder.city);
        setCityId(builder.cityId);
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCityId() {
        return cityId;
    }

    public void setCityId(String cityId) {
        this.cityId = cityId;
    }

    public static final class Builder {
        private String province;
        private String city;
        private String cityId;

        private Builder() {
        }

        public Builder province(String province) {
            this.province = province;
            return this;
        }

        public Builder city(String city) {
            this.city = city;
            return this;
        }

        public Builder cityId(String cityId) {
            this.cityId = cityId;
            return this;
        }

        public SelectLocationData build() {
            return new SelectLocationData(this);
        }
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.province);
        dest.writeString(this.city);
        dest.writeString(this.cityId);
    }

    protected SelectLocationData(Parcel in) {
        this.province = in.readString();
        this.city = in.readString();
        this.cityId = in.readString();
    }

    public static final Parcelable.Creator<SelectLocationData> CREATOR = new Parcelable.Creator<SelectLocationData>() {
        @Override
        public SelectLocationData createFromParcel(Parcel source) {
            return new SelectLocationData(source);
        }

        @Override
        public SelectLocationData[] newArray(int size) {
            return new SelectLocationData[size];
        }
    };
}
